/**
 * 
 */
package com.gopay.common.domain.cust;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

/**
 * @CustCorpExtendInfo.java
 * @author gaocl
 * @2017年1月19日 下午12:40:25  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "CUST_CORP_EXTEND_INFO")
public class CustCorpExtendInfo extends BaseEntity{

    private static final long serialVersionUID = 4943961788740975346L;
    
    private String custId;
    private String corpBankName;
    private String corpBankCode;
    private String corpBankCardHolderName;
    private String corpBankProvinceCode;
    private String corpBankProvinceName;
    private String corpBankCityCode;
    private String corpBankCityName;
    private String corpBankBranchCode;
    private String corpBankBranchName;
    private String corpBankAcctNum;
    private Date createdTs;
    private Date lastUpdTs;
    private String createdOperId;
    private String lastUpdOperId;
    private int version;
    
    @Id
    @Column(name = "CUST_ID", unique = true, nullable = false, length = 10)
    public String getCustId() {
        return custId;
    }
    public void setCustId(String custId) {
        this.custId = custId;
    }
    @Column(name = "CORP_BANK_NAME", length = 100)
    public String getCorpBankName() {
        return corpBankName;
    }
    public void setCorpBankName(String corpBankName) {
        this.corpBankName = corpBankName;
    }
    @Column(name = "CORP_BANK_CODE", length = 10)
    public String getCorpBankCode() {
        return corpBankCode;
    }
    public void setCorpBankCode(String corpBankCode) {
        this.corpBankCode = corpBankCode;
    }
    @Column(name = "CORP_BANK_CARD_HOLDER_NAME", length = 150)
    public String getCorpBankCardHolderName() {
       	/**
		 * modify by zyt，2017-4-17 在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
		 */
		this.corpBankCardHolderName = SensitiveInfoUtils.autoReencrypt(this.corpBankCardHolderName);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.corpBankCardHolderName);
    }
    public void setCorpBankCardHolderName(String corpBankCardHolderName) {
    	/**
    	 * modified by zyt，2017-4-17 判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
		 */
		this.corpBankCardHolderName = SensitiveInfoUtils.smartEncryptWithCheck(corpBankCardHolderName);
    }
    @Column(name = "CORP_BANK_PROVINCE_CODE", length = 10)
    public String getCorpBankProvinceCode() {
        return corpBankProvinceCode;
    }
    public void setCorpBankProvinceCode(String corpBankProvinceCode) {
        this.corpBankProvinceCode = corpBankProvinceCode;
    }
    @Column(name = "CORP_BANK_PROVINCE_NAME", length = 50)
    public String getCorpBankProvinceName() {
        return corpBankProvinceName;
    }
    public void setCorpBankProvinceName(String corpBankProvinceName) {
        this.corpBankProvinceName = corpBankProvinceName;
    }
    @Column(name = "CORP_BANK_CITY_CODE", length = 10)
    public String getCorpBankCityCode() {
        return corpBankCityCode;
    }
    public void setCorpBankCityCode(String corpBankCityCode) {
        this.corpBankCityCode = corpBankCityCode;
    }
    @Column(name = "CORP_BANK_CITY_NAME", length = 50)
    public String getCorpBankCityName() {
        return corpBankCityName;
    }
    public void setCorpBankCityName(String corpBankCityName) {
        this.corpBankCityName = corpBankCityName;
    }
    @Column(name = "CORP_BANK_BRANCH_CODE", length = 20)
    public String getCorpBankBranchCode() {
        return corpBankBranchCode;
    }
    public void setCorpBankBranchCode(String corpBankBranchCode) {
        this.corpBankBranchCode = corpBankBranchCode;
    }
    @Column(name = "CORP_BANK_BRANCH_NAME", length = 200)
    public String getCorpBankBranchName() {
        return corpBankBranchName;
    }
    public void setCorpBankBranchName(String corpBankBranchName) {
        this.corpBankBranchName = corpBankBranchName;
    }
    @Column(name = "CORP_BANK_ACCT_NUM", length = 150)
    public String getCorpBankAcctNum() {
    	/**
		 * modify by zyt，2017-4-17 在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
		 */
		this.corpBankAcctNum = SensitiveInfoUtils.autoReencrypt(this.corpBankAcctNum);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.corpBankAcctNum);
    }
    
    public void setCorpBankAcctNum(String corpBankAcctNum) {
    	/*
    	 * modified by zyt，2017-2-22 判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
		 */
		this.corpBankAcctNum = SensitiveInfoUtils.smartEncryptWithCheck(corpBankAcctNum);
    }
    @Column(name = "CREATED_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return createdTs;
    }
    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }
    @Column(name = "LAST_UPD_TS")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return lastUpdTs;
    }
    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }
    @Column(name = "CREATED_OPER_ID", length = 20)
    public String getCreatedOperId() {
        return createdOperId;
    }
    public void setCreatedOperId(String createdOperId) {
        this.createdOperId = createdOperId;
    }
    @Column(name = "LAST_UPD_OPER_ID", length = 20)
    public String getLastUpdOperId() {
        return lastUpdOperId;
    }
    public void setLastUpdOperId(String lastUpdOperId) {
        this.lastUpdOperId = lastUpdOperId;
    }
    @Version
    @Column(name = "VERSION", nullable = false, precision = 22, scale = 0)
    public int getVersion() {
        return version;
    }
    public void setVersion(int version) {
        this.version = version;
    }

    
}
